<?php
class NewsForMain extends CWidget
{
    public $news;

    public function init(){
        $this->news = Article::model()->findAll(array(
            'condition' => "type='news' AND is_active=1",
            'order' => 'date_created DESC',
            'limit' => 10
        ));
    }

    public function run(){
        $this->render('NewsForMain');
    }
}
